<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('评价列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li >
                            名称：<input type="text" name="storeName"/>
                        </li>
                        <li>
                            <label> 地址：</label>
                            <select name="location_id" >
                                <option value="">所有</option>
                                <option th:each="location :${locations}" th:text="${location.name}" th:value="${location.id}"></option>
                            </select>

                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>




        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var removeFlag = [[${@permission.hasPermi('evaluation:suggestion:view')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var prefix = ctx + "evaluation";
    $(function() {
        var options = {
            url:  prefix+ "/suggestionList",
            createUrl: prefix + "/addStore",
            updateUrl: prefix + "/editStore/{id}",
            removeUrl: prefix + "/removeSuggestion",
            exportUrl: prefix + "/exportSuggestion",
            cleanUrl:prefix+"/deleteEvaluation",
            editUrl:prefix+"/editStore",
            modalName: "商品列表",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '编号'
                },
                {
                    field: 'storeName',
                    title: '商铺名称',
                },
                {
                    field: 'locationName',
                    title: '地址',
                },
                {
                    field: 'content',
                    title: '内容',
                    //查询数据库，找到sort_id对应的分类名
                },
                {
                    field: 'name',
                    title: '姓名'
                },
                {
                    field: 'tel',
                    title: '电话'
                },
                {
                    field: 'time',
                    title: '时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id+'\')"><i class="fa fa-remove"></i>删除</a>&nbsp;');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    function searchPre() {
        var data = {};

        $.table.search('post-form', 'bootstrap-table', data);
    }
    function resetPre() {
        $("#post-form")[0].reset();
        $.table.search('post-form', 'bootstrap-table');
    }
    function manage(id){
        //$.modal.open('编辑子商品', prefix + "/editChildren/"+id, '666', '500');
        $.modal.open("编辑商铺",prefix+"/editStore/"+id,'666','500');
    }
</script>

</body>
</html>